<template>
  <div id="app">
    <h2 v-text="msg" ref="title"></h2>
    <button @click="showDOM">click me to show the dom</button>
    <school ref="sch"></school>
  </div>
</template>

<script>
import School from "./components/School.vue";
export default {
  name: "app",
  components: {
    School,
  },
  data() {
    return {
      msg: "欢迎来到Vue",
    };
  },
  methods:{
     showDOM(){
        console.log(this.$refs.title);
        console.log(this.$refs);
      // 这里可以通过vue的ref找到dom元素,以及vc组件实例对象
     }
  }
};
</script>

<style>
</style>